package com.tie.repository;

import com.tie.entity.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

@Repository
public interface UserRepository extends JpaRepository<User,Long> {

    @Query("select t from User t where t.phone = :phone")
    User findUserByPhone(@Param("phone") String phone);

    @Query("select t from User t where t.phone = :phone and t.password = :password")
    User findUserByPassword(@Param("phone") String phone,@Param("password")String password);
}
